
import request from "@/utils/request";
class MenuAPI {
  /*     获取列表     */
  static getList () {
    return request({
      url: "/api/admin/menus",
      method: "GET"
    });
  }
  /*     获取路由列表     */
  static getRoutesList () {
    return request({
      url: "/api/admin/menu-routes",
      method: "GET"
    });
  }
  /*     获取路由列表     */
  static getOptions () {
    return request({
      url: "/api/admin/menu-options",
      method: "GET"
    });
  }

  /*     添加     */
  static add (data) {
    return request({
      url: "/api/admin/menus",
      method: "POST",
      data
    });
  }
  /*     获取    */
  static get (id) {
    return request({
      url: `/api/admin/menu/${id}`,
      method: "GET",
    });
  }
  /*     修改    */
  static put (data) {
    return request({
      url: `/api/admin/menus/${data.id}`,
      method: "PUT",
      data
    });
  }
  /*     删除     */
  static del (data) {
    return request({
      url: `/api/admin/menu/${data.id}`,
      method: "DELETE",
    });
  }
}
export default MenuAPI;